package com.bw.crop.mapper;

import com.bw.crop.domain.SysCropStash;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
* @author 86198
* @description 针对表【sys_crop_stash】的数据库操作Mapper
* @createDate 2024-05-25 12:49:32
* @Entity com.bw.crop.domain.SysCropStash
*/
public interface SysCropStashMapper extends BaseMapper<SysCropStash> {



    @Select("SELECT sum(num) FROM sys_crop_stash WHERE crop_name = #{name} AND num!=0 GROUP BY crop_name,fsid,stash_id HAVING stash_id=#{sid} and fsid=#{fsid}")
    Integer getOneNum(@Param("name") String name,@Param("fsid") Integer fsid,@Param("sid") Integer sid);

    @Select("SELECT * FROM sys_crop_stash WHERE crop_name = #{cname} AND stash_id=#{sid} AND fsid=#{fsid} AND num!=0 ORDER BY create_date")
    List<SysCropStash> getNumList(@Param("cname")String cname, @Param("sid")Integer sid,@Param("fsid")Integer fsid);

    List<SysCropStash> getCropList();

    List<SysCropStash> getlistxun(@Param("s1")Integer s1, @Param("s2")Integer s2);

    List<SysCropStash> getlist();
}




